import http from "../../utils/requestAI.ts"; // 修正拼写错误
import type { addPrems } from "../section/type.ts";
import  { type editPrems } from "../section/type.ts";
import { type ExampleGenerate, type Data } from "./type.ts";
// import { type addPrems } from "./type.ts";

// 列表
export const getCompanys = (params?: Data) => {
  return http.get<ExampleGenerate>('/role/list', params);
}

// 删除
export const delCompany = (id: number) => {
  console.log('单选删除执行', id);
  return http.delete(`/role/delete/${id}`);
}

//多删
export const delCompanyAll = (ids: number[]) => {
  console.log('批量删除执行', ids);
  return http.post(`/role/deleteAll`,ids);
}

// 添加
export const addCompany = (data: addPrems) => {
    return http.post(`/role/add`, data);
  }
  
  // 修改
  export const editPremsd = (data: editPrems) => {
    return http.post(`/role/add`, data);
  }

//// 编辑
  export const editCompany = (id: number) => {
    return http.get(`/role/get/${id}`);
  }
  